<template>
  <div class="day_wrap">
    <div @click="toDetail(1)" class="left">
      <el-image
        :src="require('@/assets/img/wallhaven-d5ek23.jpg')"
        fit="fill"
      ></el-image>
      <div class="title">每日推荐</div>
    </div>
    <div @click="toDetail(2)" class="right">
      <el-image
        :src="require('@/assets/img/wallhaven-8ogod1.jpg')"
        fit="fill"
      ></el-image>
      <div class="title">私人FM</div>
    </div>
  </div>
</template>

<script>
export default {
  name: "Foryou",

  data() {
    return {};
  },

  mounted() {},

  methods: {
    //跳转至每日推荐
    toDetail(index) {
      if (index == 1) {
        this.$router.push("/dayMusic");
      } else {
        this.$router.push("/fm");
      }
    },
  },
};
</script>

<style lang="less" scoped>
.day_wrap {
  margin: 20px 0;
  display: flex;
  justify-content: space-between;
  .left,
  .right {
    height: 15rem;
    width: 45%;
    background-color: #ddd;
    overflow: hidden;
    border-radius: 20px;
    position: relative;
    .el-image {
      //   width: 100%;
      //   height: 100%;
      border-radius: 20px;
      animation: left 15s infinite alternate-reverse;
    }
    .title {
      left: 30px;
      font-size: 30px;
      font-weight: 600;
      position: absolute;
      top: 20px;
      color: #fff;
    }
    @keyframes left {
      from {
        transform: translateY(0px);
      }
      to {
        transform: translateY(-50px);
      }
    }
  }
}
</style>